package org.styx.datasource;

import lombok.experimental.UtilityClass;
import lombok.extern.slf4j.Slf4j;

@UtilityClass
@Slf4j
public class DSContextHolder {
    private final ThreadLocal<Integer> contextHolder=new ThreadLocal<>();

    public Integer getDSType(){
        return contextHolder.get();
    }

    public void setDSType(final Integer dataSourceType){
        contextHolder.set(dataSourceType);
    }

    public void clearDSType(){
        contextHolder.remove();
    }
}
